package com.example.im.bean

import android.os.Parcel
import android.os.Parcelable
import java.util.ArrayList

/**
 * @author  chaohaipeng  on 2018/7/25.
 */
class GroupListObj() : Parcelable {
    var id: String=""
    var name: String=""
    var faceUrl: String=""
    var count: Int = 0
    var groupUserList: ArrayList<GroupMemberObj>?=null


    constructor( `in`: Parcel) : this() {
        id = `in`.readString()
        name = `in`.readString()
        faceUrl = `in`.readString()
        count = `in`.readInt()
        groupUserList = `in`.createTypedArrayList(GroupMemberObj)
    }

    override fun writeToParcel(dest: Parcel, flags: Int) {
        dest.writeString(id)
        dest.writeString(name)
        dest.writeString(faceUrl)
        dest.writeInt(count)
        dest.writeTypedList(groupUserList)
    }

    override fun describeContents(): Int {
        return 0
    }

    companion object CREATOR : Parcelable.Creator<GroupListObj> {
        override fun createFromParcel(parcel: Parcel): GroupListObj {
            return GroupListObj(parcel)
        }

        override fun newArray(size: Int): Array<GroupListObj?> {
            return arrayOfNulls(size)
        }
    }
}